﻿CREATE VIEW [dbo].[ASMS_V_Supplier]
	AS 
SELECT S.*,
	MDICountry.[Name] as CountryName,
	MDICity.Name as CityName,
	MDIProvince.Name as ProvinceName,
	MDIDistrict.Name as DistrictName 
from ASMS_Supplier as S
	left join [ASMS_MasterDataItem] as MDICountry on MDICountry.Code= S.Country
	left join [ASMS_MasterDataItem] as MDICity on MDICity.Code= S.City
	left join [ASMS_MasterDataItem] as MDIProvince on MDIProvince.Code= S.Province
	left join [ASMS_MasterDataItem] as MDIDistrict on MDIDistrict.Code= S.District
